using System;
using System.Xml;
using System.Data;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class XmlReaderAndXml : System.Web.UI.Page
{
    
    

    protected void Page_Load(object sender, EventArgs e)
    {
        string connectionString =  
        WebConfigurationManager.ConnectionStrings[
        "RCVDB2000"].ConnectionString;
        if(!IsPostBack)
        {
            try
            {
                SqlServerProvider sqlServerProvider =
                new SqlServerProvider(connectionString);
                sqlServerProvider.CommandText =
                "Select top 10 UserID, Email,"
                + " FirstName, LastName, Address" +
                " from tblJSAccounts for XML Auto ";
                XmlReader xmlReader = sqlServerProvider.ExecuteXmlReader();
                Literal1.Text =  xmlReader.ReadString();
                
             }
            catch (Exception ex)
            {
                Literal1.Text = ex.Message;
            }
        }
    }
     
 
}
